package com.example.model;

/**
 * 商品实体
 *
 * @author 某某
 * @since 2025-09-23
 */
public class Product {

    /* ========================= 属性 ========================= */

    /** 商品名称 */
    private String name;

    /** 商品价格 */
    private double price;

    /* ======================= 构造方法 ======================= */

    /** 无参构造：Spring 容器必备 */
    public Product() {
    }

    /** 全参构造：手动 new 时方便 */
    public Product(String name, double price) {
        this.name = name;
        this.price = price;
    }

    /* ======================== Getter/Setter ======================== */

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public double getPrice() {
        return price;
    }

    public void setPrice(double price) {
        this.price = price;
    }

    /* ======================== 业务方法 ======================== */

    @Override
    public String toString() {
        return "Product{name='" + name + "', price=" + price + "}";
    }
}